package com.ykt.controller;

import com.ykt.common.constant.ParamNames;
import com.ykt.service.OrderService;
import com.ykt.vo.ResultVo;
import com.ykt.vo.StatisticsOrderVo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author long.hua
 * @version 1.0.0
 * @since 2016-04-19 22:48
 */
public class StatisticsController extends BaseController{

    private OrderService orderService = enhance(OrderService.class.getName(), OrderService.class);


    public void orders(){
        int shopId = getParaToInt(ParamNames.shopId, -1);
        String orderStatus = getPara(ParamNames.orderStatus);
        String date = getPara("date");

        Map<String, Object> paramMap = new HashMap<>();
        paramMap.put(ParamNames.shopId, shopId);
        paramMap.put(ParamNames.orderStatus, orderStatus);
        paramMap.put(ParamNames.date, date);

        StatisticsOrderVo vo = orderService.statisticsOrder(paramMap);
        returnJson(ResultVo.success(vo));
    }

}
